﻿using SUNRPA.CONTROLS.IMPL.domain.attrubutes;
using SUNRPA.CONTROLS.IMPL.domain.constant;
using SUNRPA.CONTROLS.IMPL.domain.flowRunningVar;
using SUNRPA.CONTROLS.IMPL.util;
using System.Collections.Concurrent;
/// <summary>
/// Excel有Office和Wps目前只支持Office后期加入Wps支持。
/// </summary>
namespace SUNRPA.CONTROLS.IMPL.domain.flowItemParam {
    [VarFieldName("AfterCopyPath")]
    [Serializable]
    public class CopyFileNParam : BaseParam {
        private string waitCopyFile;
        private string targetParentPath;
        //0覆盖、1不要拷贝、2自动添加后缀
        private int ifExist = 0;
        private string afterCopyPath = "filePath";
        public string WaitCopyFile {
            get => waitCopyFile; 
            set {
                waitCopyFile = value;
                NotifyPropertyChanged("WaitCopyFile");
            }  
        }
        public string TargetParentPath {
            get => targetParentPath; 
            set {
                targetParentPath = value;
                NotifyPropertyChanged("TargetParentPath");
            }
         }
        public string AfterCopyPath {
            get => afterCopyPath;
            set
            {
                afterCopyPath = value;
                NotifyPropertyChanged("AfterCopyPath");
            }
        }

        public int IfExist {
            get => ifExist;
            set
            {
                ifExist = value;
                NotifyPropertyChanged("IfExist");
            }
        }

        public string GetTranslateIfExist() {
            if(this.ifExist == 0) { 
                return "覆盖";
            }else if(this.ifExist == 1) {
                return "不拷贝";
            } else { 
                return "自动添加后缀";
            }
        }
        public override void SetLatestVarName(ConcurrentDictionary<string, ConcurrentDictionary<string, RPAVariableDefineWrapper>> globleData) {
            this.afterCopyPath = this.GetLatestName(this.afterCopyPath, globleData);
        }
    }
}
